package com.example.blog.dao;

import com.example.blog.common.StringUtil;
import com.example.blog.model.UserInfo;
import com.example.blog.model.vo.UserInfoVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @Author YJ
 * @Date 2023/9/5 15:35
 * Description:
 */
@Mapper
public interface UserMapper {

    @Insert("insert into user(username,password) values(#{username},#{password})")
    int reg(UserInfo userInfo);

    @Select("select * from user where username=#{username}")
    UserInfo selectByUserName(@Param("username") String username);

    @Select("select * from user where userId=#{userId}")
    UserInfoVO selectByUserId(@Param("userId") int userId);
}
